package cc.idoone.springframework.placeholder.ann;

import cc.idoone.springframework.placeholder.PlaceholderService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @auther: hemj
 * @since: 2018/8/1
 */
@Service("annoPlaceholderService")
public class AnnoPlaceholderServiceImpl implements PlaceholderService {
    @Value("#{systemProperties['java.vm.version']}")
    private String jvmVersion;
    @Value("#{systemProperties['myPort']}")
    private String myPort;
    @Value("#{config['spring.str']}")
    private String configStr;
    @Value("${spring.str}")
    private String str;
    @Value("${spring.myint}")
    private int myInt;
    // @Value("${spring.mylist}")
    private List<String> myList;
    // @Value("${spring.mymap}")
    private Map<String, String> myMap;
    // @Autowired
    // private UploadConfiguration uploadConfiguration;

    @Override
    public void hello() {
        System.out.println("systemProperties java.vm.version=" + jvmVersion);
        System.out.println("systemProperties myPort=" + myPort);
        System.out.println("config spring.str=" + configStr);
        System.out.println("str=" + str);
        System.out.println("myInt=" + myInt);
        System.out.println("myList=" + myList);
        System.out.println("myMap=" + myMap);
        // System.out.println("con=" + uploadConfiguration.getUploadRule("default"));
    }
}
